#include <iostream>
using namespace std;
class temp;
class Date{
	int a;
	int b;
	int c;
public:
	Date():a(10),b(10),c(10){}
	void seta(int aa){a=aa;}
	void setb(int bb){a=bb;}
	void setc(int cc){c=cc;}
	int geta(){return a;}
	int getb(){return b;}
	int getc(){return c;}
	void setdata(temp*);
	void show()
	{
		cout << "a=" << a << endl;
		cout << "b=" << b << endl;
		cout << "c=" << c << endl;

	}
};
class temp
{
public:
	int a;
	temp():a(10){}
	virtual void add(Date&Date){}
};
class temp1:public temp
{
	int b;
public:
	temp1():b(5){}
	void add(Date&Date)
	{

		Date.seta(a+Date.geta());
	}
};

void Date::setdata(temp*temp)
{
	temp->add(*this);
}
int main()
{
	Date a;
	a.show();
	temp1 t1;
	a.setdata(&t1);
	a.show();

	return 0;
}
